package org.dtrd.modules.doctor.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.dtrd.config.system.Constant;
import org.dtrd.modules.doctor.entity.po.DtrdEntRdDoctor;

/**
 * @author qr
 * @date 2021/12/1 13:45
 */
@ApiModel(value = "医生信息", description = "用于在团队列表中展示")
@Data
public class TeamDoctorInfo {

    @ApiModelProperty("医生id")
    private Integer dataId;

    @ApiModelProperty("医生头像")
    private String doctorAvatar;

    @ApiModelProperty("医生名字")
    private String doctorName;

    @ApiModelProperty("医生类型")
    private Integer doctorType;

    @ApiModelProperty("医生类型名称")
    private String doctorTypeName;

    @ApiModelProperty("医生的手机号")
    private String doctorMobile;

    private Boolean isManager;

    @ApiModelProperty("医生职称")
    private String doctorsLevel;

    public TeamDoctorInfo parseFromPo(DtrdEntRdDoctor po) {
        this.dataId = po.getDataId();
        this.doctorAvatar = po.getDoctorsImg();
        this.doctorName = po.getDoctorsName();
        Integer doctorsType = po.getDoctorsType();
        if (doctorsType != null) {
            this.doctorType = doctorsType;
            this.doctorTypeName = Constant.Executor.valueOf(doctorsType).getName();
        }
        this.doctorMobile = po.getDoctorsMobile();
        this.doctorsLevel = po.getDoctorsLevel();
        return this;
    }
}
